#include "NodeVarForMatrix.h"
#include "DumpLog.h"

namespace Net
{

NodeVarForMatrix::NodeVarForMatrix(std::size_t row, std::size_t col): BaseNodeVar(NodeVarType_E::Matrix_E)
{
    if (row < 1 || col < 1)
    {
        LogError("Matrix初始化时,行列参数必须大于等于1, row = {}, col = {}", row, col);
        return;
    }

    value.resize(row, col);
    diffValue.resize(row, col);
}

NodeVarForMatrix::~NodeVarForMatrix()
{

}

uint32_t NodeVarForMatrix::getVarSize() const
{
    return value.size();
}

std::vector<std::size_t> NodeVarForMatrix::getDim() const
{
    return {static_cast<std::size_t>(value.rows()), static_cast<std::size_t>(value.cols())};
}

}